package com.example.makerspace.dao;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.makerspace.domain.ArtworkReviewDO;
import com.example.makerspace.domain.RecommendDO;
import com.example.makerspace.mapper.RecommendMapper;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

@Component
public class RecommendDAO extends  BaseDAO<RecommendDO> {

    @Resource
    private RecommendMapper recommendMapper;
    @PostConstruct
    public void init(){
        this.mapper = recommendMapper;
    }

    public void deleteByUsernameAndCompetitionId(String username, Integer id) {
        QueryWrapper<RecommendDO> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("username",username).eq("id",id);
        recommendMapper.delete(queryWrapper);
    }
}
